package leetcode.code881.BoatstoSavePeople;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class BoatstoSavePeople implements IDebug {

	abstract public int numRescueBoats(int[] people, int limit);

	@Override
	public void debug1() {
//		Input: people = [1,2], limit = 3
//		Output: 1
//		Explanation: 1 boat (1, 2)
		String string = "[1,2]";
		int limit = 3;
		int expect = 1;
		this.debug(string, limit, expect);
	}

	private void debug(String string, int limit, int expect) {
//		String string = "[1,2]";
//		int limit = 3;
//		int expect = 1;
		int[] people = HelpDebug.str2array3(string);
		int result = this.numRescueBoats(people, limit);
		HelpDebug.printInputs(expect, new Object[] { people, limit });
		HelpDebug.printObject(result);
		System.out.println(">>>>>>>>>>" + (result == expect));
	}

	@Override
	public void debug2() {
//		Input: people = [3,2,2,1], limit = 3
//		Output: 3
//		Explanation: 3 boats (1, 2), (2) and (3)

		String string = "[3,2,2,1]";
		int limit = 3;
		int expect = 3;
		this.debug(string, limit, expect);
	}

	@Override
	public void debug3() {
//		Input: people = [3,5,3,4], limit = 5
//		Output: 4
//		Explanation: 4 boats (3), (3), (4), (5)
		String string = "[3,5,3,4]";
		int limit = 5;
		int expect = 4;
		this.debug(string, limit, expect);

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

}
